<input type="hidden" name="group"/>
<div class="panel panel-default panel-spawner">
  <div class="panel-body">
    <label>Instance Types</label>
    <div id="instance-type-warn" style="margin: 10px 0px 15px 5px;" hidden>
      <i class="fa fa-exclamation-circle" aria-hidden="true" style="color: #faad15;"></i>
      <span id="instance-type-warn-text"></span>
    </div>
    <div id="it-container" class="form-group"></div>
    <hr/>
    <label>Images</label>
    <div id="image-warn" style="margin: 10px 0px 15px 5px;" hidden>
      <i class="fa fa-exclamation-circle" aria-hidden="true" style="color: #faad15;"></i>
      <span id="image-warn-text"></span>
    </div>
    <div id="image-container" class="form-group"></div>
    <div>
      <a class="collapsed" data-toggle="collapse" href="#advanced-setup">
        <i class="fa fa-chevron-down"></i>
        Show advanced settings
        <i class="fa fa-info-circle" aria-hidden="true" data-toggle="tooltip" data-placement="right" title="Enable advanced settings for special purpose."></i>
      </a>
    </div>
    <div id="advanced-setup" class="collapse">
      <input type="checkbox" name="safe_mode" id="safe_mode" >&nbsp;
      <label for="safe_mode">Enable Safe Mode <i class="fa fa-info-circle" aria-hidden="true" data-toggle="tooltip" data-placement="right" title="Safe Mode mounts your persistent home directory under /home/jovyan/user."></i></label>
    {% if enable_kernel_gateway %}
      <br />
      <input type="checkbox" name="kernel_gateway" id="kernel_gateway" >&nbsp;
      <label for="kernel_gateway">(Experimental) JupyterLab 1.0 with kernel gateway</label>
    {% endif %}
    {% if enable_ssh_server %}
      <br />
      <input type="checkbox" name="ssh_server" id="ssh_server" >&nbsp;
      <label for="ssh_server"> Enable SSH Server </label>
      <div id="ssh-information">
        🔑&emsp;<strong>From your jupyter notebook</strong>
        <p>
          Add your public key into <code>~/.ssh/authorized_keys</code> in your jupyter notebook. <a href="https://docs.primehub.io/docs/next/guide_manual/ssh-config#deploy-public-key-into-jupyterhub" rel="noreferrer" target="_blank">[Doc]</a>
        </p>
        💻&emsp;<strong>From your local machine</strong>
        <p>
          Copy and paste the example below into your <code>~/.ssh/config</code>. Then replace <code>~/.ssh/id_rsa</code> with your private key location.
        </p>
        <p>
          <pre class='snippet'><code>HOST {{ ssh_config.hostname }}
  User jovyan
  Hostname {{ ssh_config.hostname }}
  Port 22
  ForwardAgent yes
  ProxyCommand ssh -W %h:%p -i <i>~/.ssh/id_rsa</i> limited-user@{{ ssh_config.host }} -p {{ ssh_config.port }}
  IdentityFile <i>~/.ssh/id_rsa</i>
  StrictHostKeyChecking no
  UserKnownHostsFile=/dev/null</code></pre>
        </p>
        <p>
          After these steps, you will be able to successfully connect to your notebook.
        </p>
        <p>
          <pre class='snippet'><code>$ ssh jupyter</code></pre>
        </p>
      </div>
    {% endif %}
    </div>

    <script type="text/javascript">
      PrimeHubContext = {{ {'groups': groups} | tojson }};
      SpawnOptions = {{ {'default_image': default_image, 'default_instance_type': default_instance_type, 'autolaunch': autolaunch} | tojson }};
    </script>
  </div>
</div>
<div class="alert alert-warning hide" role="image-not-match-gpu-instance">
  <strong>WARNING:</strong> You choose a instance with GPU resource, but the image may not be optimized for GPU.
</div>
